import fetch from '../utils/fetch'
export function getShare(start,order) {
  return fetch({
    url: '/get/all/communicate',
    method: 'post',
    data:{
        start,order
    }
  })
}

export function getComment(id) {
  return fetch({
    url: '/dis/comment',
    method: 'get',
    params:{
        id
    }
  })
}





export function getDiscussionById(id) {
  return fetch({
    url: '/get/discussion/by/id',
    method: 'get',
    params:{
        id
    }
  })
}






export function addComment(dis_id,text,username,avatar,parent_id,to_user,to_comment,comment_user) {
  return fetch({
    url: '/add/comment',
    method: 'post',
    data:{
        dis_id,
        text,
        username,
        avatar,
        parent_id,
        to_user,
        to_comment,
        comment_user
    }
  })
}


export function addPraise(id) {
  return fetch({
    url: '/add/praise',
    method: 'get',
    params:{
        id
    }
  })
}



